﻿#include "FITKAbaEngineeringFeature.h"
#include "FITKAbaInertiaManager.h"
#include "FITKAbaSpringDashpotManager.h"

namespace Interface
{
    FITKAbaPartEngineeringFeature::FITKAbaPartEngineeringFeature()
    {
        //创建惯量管理器
        _inertiaManager = new FITKAbaInertiaManager;
        //弹簧管理器
        _springDashManager = new FITKAbaSpringDashpotManager;

    }

    FITKAbaPartEngineeringFeature::~FITKAbaPartEngineeringFeature()
    {
        //释放内存
        if (_inertiaManager) delete _inertiaManager;
        if (_springDashManager) delete _springDashManager;
    }

    FITKAbaInertiaManager* FITKAbaPartEngineeringFeature::getInertiaManager()
    {
        return _inertiaManager;
    }

    Interface::FITKAbaSpringDashpotManager* FITKAbaPartEngineeringFeature::getSpringDashManager()
    {
        return _springDashManager;
    }

    void FITKAbaPartEngineeringFeature::setParentDataID(const int id)
    {
        FITKAbstractDataObject::setParentDataID(id);
        _inertiaManager->setParentDataIDM(id);
        _springDashManager->setParentDataIDM(id);
    }

    void FITKAbaPartEngineeringFeature::clear()
    {
        //释放内存
        if (_inertiaManager)     _inertiaManager->clear();
        if (_springDashManager)  _springDashManager->clear();
    }

    void FITKAbaAssemblyEngineeringFeature::setParentDataID(const int id)
    {
        FITKAbaPartEngineeringFeature::setParentDataID(id);
    }

}